package com.bank.service;

import com.bank.entity.UserInfo;
import com.bank.repository.UserInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserInfoService {
    @Autowired
    private UserInfoRepository userInfoRepository;

    public UserInfo save(UserInfo userInfo) {
        return userInfoRepository.save(userInfo);
    }

    public java.util.Optional<UserInfo> findById(Long customerID) {
        return userInfoRepository.findById(customerID);
    }

    public java.util.List<UserInfo> findAll() {
        return userInfoRepository.findAll();
    }

    public void deleteById(Long id) {
        userInfoRepository.deleteById(id);
    }

    public java.util.List<UserInfo> findByKeyword(String keyword) {
        return userInfoRepository.findByKeyword(keyword);
    }
}